package com.longteng.java.web.db;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * Created by tianqing.wang
 * DATE : 2018/4/15
 * TIME : 上午12:20
 * PROJECT : web-lesson
 * PACKAGE : com.longteng.java.web.db
 *
 * @author <a href="mailto:celeskyking@163.com">tianqing.wang</a>
 */
public class DriverMangerDemo {


    private static final String JDBC_DRIVER = "com.mysql.jdbc.Driver";


    private static final String DB_URL = "";


    private static final String USER = "";


    private static final String DB_PASSWORD = "";


    public static void main(String[] args) throws ClassNotFoundException {
        Class.forName(JDBC_DRIVER);
        try(Connection connection = DriverManager.getConnection(DB_URL,USER,DB_PASSWORD);
            PreparedStatement statement = connection.prepareStatement("select * from test");
            ResultSet resultSet = statement.executeQuery()){
            //do something;
        }catch (Exception e){

        }

    }


}
